package com.banksystem.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.banksystem.entity.Liuyan;
import com.banksystem.entity.News;

public interface Liuyanmapper {

	@Select("select * from liuyan where name=#{gname}")
	public List<Liuyan> findliuyanall(@Param("gname")String gname);
	
	@Select("select * from liuyan")
	public List<Liuyan> adminfindliuyanall();
	
	@Delete("delete from liuyan where id=#{id}")
	public void deletely(@Param("id")String id);
	
	@Select("select * from liuyan where name like'%${gname}%' and ( name like'%${seach}%' or title like'%${seach}%' or id like'%${seach}%' or js like'%${seach}%' or date like'%${seach}%')")
	public List<Liuyan> findliuyanAlllike(@Param("seach")String seach,@Param("gname")String gname);
	
	@Select("insert into liuyan (name,title,js,date) values (#{name},#{title},#{js},#{date})")
	public void addly(@Param("name")String name,@Param("title")String title,@Param("js")String js ,@Param("date")String date);
}
